/**
 * 
 */
package xiaojian.toolkit.ebus.closure;

import org.apache.commons.collections4.Closure;
import org.apache.commons.collections4.Transformer;


/**
 * @author hp
 *
 */
public class PretransformClosure implements Closure {

	private	Transformer	transformer;
	private	Closure		closure;
	
	/**
	 * @return the closure
	 */
	public Closure getClosure() {
		return closure;
	}

	/**
	 * @param closure the closure to set
	 */
	public void setClosure(Closure closure) {
		this.closure = closure;
	}

	/**
	 * @return the transformer
	 */
	public Transformer getTransformer() {
		return transformer;
	}

	/**
	 * @param transformer the transformer to set
	 */
	public void setTransformer(Transformer transformer) {
		this.transformer = transformer;
	}

	public void execute(Object input) {
		closure.execute( transformer.transform(input) );
	}

}
